package com.tiancheng.trade.settlement.mapper.settlement;

import com.tiancheng.trade.settlement.mapper.TYBaseMapper;
import com.tiancheng.trade.settlement.model.settlement.SettlementWaitBill;
import com.tiancheng.trade.settlement.vo.settlement.admin.res.PlatformBillResVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 清分待对账表
 *
 * @author chris.shao
 * @since 2024/4/20
 */
@Repository
public interface SettlementWaitBillMapper extends TYBaseMapper<SettlementWaitBill> {
    /**
     * 批量保存待对账数据
     *
     * @param waitBills
     * @return
     */
    int saveBatch(List<SettlementWaitBill> waitBills);

    /**
     * 更新对账状态为已对账
     *
     * @param subOrderKey
     * @return
     */
    int updateStatus(List<String> subOrderKey);

    /**
     * 更新清分规则异常的数据为已对账
     *
     * @param subOrderKey
     * @return
     */
    int updateRuleExceptionStatus(List<String> subOrderKey);

    /**
     * 删除批量处理的待对账数据
     *
     * @param subOrderKey
     * @return
     */
    int deleteRematchData(List<String> subOrderKey);

    /**
     * 删除待对账数据
     *
     * @param subOrderKey
     * @return
     */
    int deleteWaitBill(List<String> subOrderKey);

    /**
     * 按子订单编号查询平台清分流水信息
     *
     * @param subOrderId
     * @return
     */
    List<PlatformBillResVO> selectPlatformBill(@Param("subOrderId") String subOrderId);

    /**
     * 按子订单编号查询平台清分流水信息
     *
     * @param subOrderId
     * @return
     */
    List<PlatformBillResVO> selectPlatformWaitBill(@Param("subOrderId") String subOrderId);
}